package com.sam.im.heiqun.uis.adapters.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sam.im.heiqun.R;
import com.sam.im.heiqun.uis.adapters.FriendAdpter;

/**
 * Created by wangguodong on 2017/1/8.
 *
 */

public class FriendHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    public final View mView;
    public final ImageView head_image;
    public final ImageView state_image;
    public final ImageView image_head_tip;
    public final TextView name;
    public final TextView text_pinyin;
    public final TextView item_detail;
    private FriendAdpter.FriendListClickListener mFriendListClickListener;

    public FriendHolder(View view, FriendAdpter.FriendListClickListener newFriendListClickListener) {
        super(view);
        mView = view;
        this.mFriendListClickListener =newFriendListClickListener;
        head_image = (ImageView) view.findViewById(R.id.img);
        state_image = (ImageView) view.findViewById(R.id.invitation_state_image);
        image_head_tip = (ImageView) view.findViewById(R.id.image_head_tip);
        name = (TextView) view.findViewById(R.id.item_name);
        text_pinyin = (TextView) view.findViewById(R.id.text_pinyin);
        item_detail = (TextView) view.findViewById(R.id.item_detail);

        view.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        if (mFriendListClickListener!=null)
        {
            mFriendListClickListener.onAgreeNewFriendClick(v,getAdapterPosition());
        }
    }
}